class code2 {
    //调整数组顺序使奇数位于偶数前面
    public int[] trainingPlan(int[] actions) {
        int left = 0,right = actions.length-1;
        while(left < right) {
            while(left < right && actions[left] % 2 == 1) {
                left++;
            }
            while(left < right && actions[right] % 2 == 0) {
                right--;
            }
            int tmp = actions[left];
            actions[left] = actions[right];
            actions[right] = tmp;
        }
        return actions;
    }
}